﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WpfApplicationExperimental
{

    //the basic perpose for this is to track the addition or removal from UI controls
    /// <summary>
    /// this is an observable collection of dao object .
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class DAOCollection<T> : System.Collections.ObjectModel.ObservableCollection<T> where  T :DataAccesLayer .DomainModel .BaseDataAccesObject 
    {

        // Summary:
        //     Initializes a new instance of the System.Collections.ObjectModel.ObservableCollection<T>
        //     class.
        public DAOCollection():base (){}
        //
        // Summary:
        //     Initializes a new instance of the System.Collections.ObjectModel.ObservableCollection<T>
        //     class that contains elements copied from the specified collection.
        //
        // Parameters:
        //   collection:
        //     The collection from which the elements are copied.
        //
        // Exceptions:
        //   System.ArgumentNullException:
        //     The collection parameter cannot be null.
        public DAOCollection(IEnumerable<T> collection)
            : base(collection)
        {

            foreach (DataAccesLayer.DomainModel.BaseDataAccesObject dao in collection)
                dao.OnEndEdit += new EventHandler(dao_OnEndEdit);
        }


        void dao_OnEndEdit(object sender, EventArgs e)
        {
         

        }

        //
        // Summary:
        //     Initializes a new instance of the System.Collections.ObjectModel.ObservableCollection<T>
        //     class that contains elements copied from the specified list.
        //
        // Parameters:
        //   list:
        //     The list from which the elements are copied.
        //
        // Exceptions:
        //   System.ArgumentNullException:
        //     The list parameter cannot be null.
        public DAOCollection(List<T> list) : base(list) { }

        
    }
}
